Skip to content

Fix crash on non-HTTP scheme links#205

Merged
mbarta merged 2 commits into
hotwired:mainfrom
leonvogt:fix-crash-on-non-http-links
Jul 27, 2026
Merged

Fix crash on non-HTTP scheme links#205
mbarta merged 2 commits into
hotwired:mainfrom
leonvogt:fix-crash-on-non-http-links

Conversation

@leonvogt

Copy link
Copy Markdown
Contributor

Tapping a mailto:, tel: or custom-scheme link crashes with MalformedURLException: unknown protocol.

Since cb80529 (#203), Navigator.getRouteDecision() eagerly resolves path-config properties for the proposed location, and PathConfigurationData.path() parses it with java.net.URL. But only supports http, so it throws before any RouteDecisionHandler runs.

Reproduce: Click on a <a href="mailto:me@domain.com">me@domain.com</a> link.

Verified in the Demo app. 1.2.8 works and 1.3.0 crashes. This PR would fix it.

leonvogt and others added 2 commits July 24, 2026 09:17
The tel:, sms: and custom scheme cases also guard the fix when running
on the JVM: the desktop JDK bundles a mailto protocol handler, so the
mailto case alone would pass even without the fix. Android's libcore
has no mailto handler and throws for all of these schemes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@mbarta mbarta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, @leonvogt!

@mbarta
mbarta merged commit 3baa2a0 into hotwired:main Jul 27, 2026
1 check passed
@leonvogt
leonvogt deleted the fix-crash-on-non-http-links branch July 27, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants